{extend name="admin@common/main"/}
{block name="body"}
    <div class="main-title">
        <h2>{:lang('_PACK_STEP_LAST_')}
            <small>{:lang('_PACK_STEP_LAST_VICE_')}</small>
        </h2>
    </div>

    <div class="with-padding">
        <div class="alert alert-success">
            {:lang('_PACK_CONGRATULATION_')}
        </div>
        <div class="clearfix">

            <div class="alert alert-info">
                {:lang('_PACK_MODULE_NOW_')}{:lang('_COMMA_')}<strong>{$module.alias}-{$module.name}</strong>
            </div>
        </div>
        <form id="form_main" action="{:url('module5')}" method="post">
            <div class="clearfix">

                <p class="lead">{:lang('_PACK_GUIDE_JSON_CONTENT_')}</p>
                <p>{:lang('_PACK_GUIDE_CONTENT_')}</p>
                {neq name="guide" value=""}
                        <textarea name="guide" class="form-control" style="height: 200px">{:json_encode($guide)}</textarea>
                {else/}
                    <div class="alert alert-success">{:lang('_PACK_DETECTED_RELATED_TABLE_NONE_SKIP_')}</div>
                {/neq}

            </div>
            <div class="clearfix">
                <p class="lead">{:lang('_PACK_INSTALL_SCRIPT_')}</p>

                <p>{:lang('_PACK_INSTALL_SCRIPT_CONTENT_')}</p>
                {neq name="install" value=""}

                        <textarea name="install" class="form-control" style="height: 200px">{$install}</textarea>

                {else/}
                    <div class="alert alert-success">{:lang('_PACK_INSTALL_SCRIPT_NULL_')}</div>
                {/neq}
                <script>
                    $(function () {
                        $('[data-role=check_table]').change(function () {
                            $.post(U('Admin/Devtool/backup_rows'),$('#form_main').serialize(),function(msg){
                                $('[name=sql_rows]').val(msg)
                            })
                        })
                    })
                </script>

            </div>
            <div class="clearfix">
                <p class="lead">{:lang('_PACK_CLEAR_DATA_SCRIPT_')}</p>

                <p>{:lang('_PACK_CLEAR_DATA_SCRIPT_CONTENT_')}</p>
                {neq name="cleanData" value=""}

                    <textarea name="install" class="form-control" style="height: 200px">{$cleanData}</textarea>

                {else/}
                    <div class="alert alert-success">{:lang('_PACK_CLEAR_DATA_SCRIPT_NULL_')}</div>
                {/neq}
                <script>
                    $(function () {
                        $('[data-role=check_table]').change(function () {
                            $.post(U('Admin/Devtool/backup_rows'),$('#form_main').serialize(),function(msg){
                                $('[name=sql_rows]').val(msg)
                            })
                        })
                    })
                </script>

            </div>
            <div class="clearfix">
                <label class="text-danger">{:lang('_PACK_AUTO_REPLACE_')}</label>
            </div>
            <div class="clearfix" style="margin-top:10px;">
                <a class="btn btn-lg btn-default" href="{:url('module4')}">
                    {:lang('_STEP_PREV_')}
                </a>
                
                <a href="{:url('module')}" class="btn btn-lg btn-warning" >
                    {:lang('_PACK_UP_RE_')}
                </a>
                <a target="_blank" href="{:url('replace')}" class="ajax-get btn btn-lg btn-danger" style="width: 200px">
                    {:lang('_PACK_REPLACE_INSTALL_FILE_')}
                </a>
                <a href="{:url('download')}" target="_blank" id="next_step" style="width: 300px" class="btn btn-lg btn-info">{:lang('_PACK_DOWNLOAD_ZIP_')}</a>
            </div>
        </form>
    </div>
{/block}